package cn.edu.scau.dormitory_management_system.module.examine.dao;

import cn.edu.scau.dormitory_management_system.module.examine.entity.CheckoutAuditEntity;
import cn.edu.scau.dormitory_management_system.module.examine.entity.VO.CheckoutAuditVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ：Vizzk
 * @description：TODO
 * @date ：2021/8/19 15:54
 */
@Mapper
public interface CheckoutAuditDao extends BaseMapper<CheckoutAuditEntity> {
    @Select("select *,is_passed as passed from tb_checkout_audit TCA, tb_flow_node TFN where checkout_id=#{checkoutId} and TCA.flow_node_id=TFN.flow_node_id")
    List<CheckoutAuditVO> listAuditVOByCheckoutId(Integer checkoutId);

    @Delete("delete from tb_checkout_audit where checkout_id = #{id}")
    boolean deleteByCheckoutId(Integer id);
}
